Skip to content

Conversation

@Lisyonok04
Copy link

ФИО: Чуева Мария
Номер группы: 6412
Номер лабораторной: 4
Номер варианта: 53
Краткое описание предметной области: Авиакомпания
Краткое описание добавленных фич: С помощью брокера сообщений Apache Kafka реализован Kafka Producer с генератором случайных данных через Bogus и добавлен Kafka Consumer, который подписывается на топик и сохраняет полученные данные в базу данных.

@github-actions github-actions bot added In progress Код в процессе проверки Lab 4 Лабораторная №4. Инфраструктура labels Dec 24, 2025
@github-actions github-actions bot requested a review from alxmcs December 24, 2025 15:37
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это надо удалить

IList<string> arrivalCity) =>
new Faker<CreateFlightDto>()
.CustomInstantiator(f => new CreateFlightDto(
FlightCode: f.Random.String2(2, "ABCDEFGHIJKLMNOPQRSTUVWXYZ") + f.Random.Number(100, 999),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Для подобной генерации нужно использовать faker.Random.Char('A', 'Z'), нет необходимости каждую генерацию создавать строку с алфавитом

Comment on lines 43 to 53
var modelId = configuration.GetSection("FlightGenerator:ModelFamilyId")
.Get<int[]>() ?? [];

var departureCity = configuration.GetSection("FlightGenerator:DepartureCity")
.Get<string[]>() ?? [];

var arrivalCity = configuration.GetSection("FlightGenerator:ArrivalCity")
.Get<string[]>() ?? [];

if (modelId.Length == 0 || departureCity.Length == 0 || arrivalCity.Length == 0)
return StatusCode(StatusCodes.Status500InternalServerError, "SeedModelIds is empty");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Все эти данные принадлежат генератору, а не контроллеру. Необходимо перенести их в генератор и сделать статическими, чтобы не дергать конфигурацию на каждый вызов метода

@Lisyonok04 Lisyonok04 requested a review from alxmcs December 25, 2025 15:50
@Lisyonok04
Copy link
Author

Мне жаль, что такой разрыв по времени между поправками получился, каюсь...

@alxmcs alxmcs added Approved Лабораторная зачтена and removed In progress Код в процессе проверки labels Dec 25, 2025
@alxmcs alxmcs closed this Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved Лабораторная зачтена Lab 4 Лабораторная №4. Инфраструктура

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants